package de.metalcon.gwt.server.db;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.index.Index;
import org.neo4j.graphdb.index.IndexManager;

public enum Indexes {
	anyNode("anyNode"), types("types"), user("user");
	
	private final String name;
	
	private Indexes(String name) {
		this.name = name;
	}

	public String toString() {
		return name;
	}
	
	public Index<Node> getIndex(GraphDatabaseService db) {
		IndexManager index = db.index();
		return index.forNodes(name);
	}
}
